//
//  AreaViewController.m
//  CalculationTabbar
//
//  Created by student on 16/2/22.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "AreaViewController.h"

extern int calCount;

@interface AreaViewController ()
@property (weak, nonatomic) IBOutlet UITextField *lengthTextField;
@property (weak, nonatomic) IBOutlet UITextField *widthTextField;
@property (weak, nonatomic) IBOutlet UITextField *areaTextField;
@property (weak, nonatomic) IBOutlet UITextField *radiusTextField;
@property (weak, nonatomic) IBOutlet UITextField *careaTextField;
@end

@implementation AreaViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


- (IBAction)backTap:(id)sender
{
    [self.view endEditing:YES];
}


- (IBAction)calbtnPressed:(id)sender
{
    float a = [self.areaTextField.text floatValue];
    float b =[self.lengthTextField.text floatValue];
    float c = [self.widthTextField.text floatValue];
    a = b*c;
    self.areaTextField.text = [NSString stringWithFormat:@"%0.2f",a];
    float d = [self.radiusTextField.text floatValue];
    float e = [self.careaTextField.text floatValue];
    e = d*d*3.1415926;
    self.careaTextField.text = [NSString stringWithFormat:@"%0.2f",e];
    calCount++;
}

@end
